package com.jacobson.huobi.entities

import android.os.Parcelable
import kotlinx.android.parcel.Parcelize
import java.io.Serializable

/** 交易对信息 */
@Parcelize
data class SymbolInfo(
    /** 市场 */
    val market: String,
    /** 是否自选 */
    val isFavorite: Boolean,
    /** 是否分析 */
    val isAnalysis: Boolean,
    /** 币 */
    val currency: String,
    /** 交易币 */
    val transCurrency: String,
    /** 当前价 */
    val realPrice: Double,
    /** 当前涨幅，+ -100 */
    val changed: Double,
    /** 4H周期1小时盈利率和 */
    val profitability: Double,
    /** 交易量 */
    val volume: Double,
    /** 是否实时初选币 */
    val realtimePrimary: Boolean,
    /** 1小时联动4小时 */
    val min60LinkH4: Boolean,
    /** 4小时联动1小时 */
    val h4LinkMin60: Boolean,
    /** 交易量分类 */
    val volumeLevel: Int,
    /** 4H优先集合 */
    val prioritySetH4: Long,
    /** 12H优先集合 */
    val prioritySetH12: Long,
    /** 日线优先集合 */
    val prioritySetDay: Long,
    /** 4H优先K线数 */
    val priorityNumH4: Long,
    /** 12H优先K线数 */
    val priorityNumH12: Long,
    /** 日线优先K线数 */
    val priorityNumDay: Long,
    /** 1小时报警信息 */
    val alarmH1: AlarmInfo,
    /** 4小时报警信息 */
    val alarmH4: AlarmInfo,
    /** 12小时报警信息 */
    val alarmH12: AlarmInfo,
    /** 日报警信息 */
    val alarmDay: AlarmInfo
) : Serializable, Parcelable {

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (javaClass != other?.javaClass) return false

        other as SymbolInfo

        if (market != other.market) return false
        if (currency != other.currency) return false
        if (transCurrency != other.transCurrency) return false

        return true
    }

    override fun hashCode(): Int {
        var result = market.hashCode()
        result = 31 * result + currency.hashCode()
        result = 31 * result + transCurrency.hashCode()
        return result
    }

    override fun toString(): String {
        return "SymbolInfo(market='$market', isFavorite=$isFavorite, isAnalysis=$isAnalysis, currency='$currency', transCurrency='$transCurrency', realPrice=$realPrice, changed=$changed, profitability=$profitability, volume=$volume, realtimePrimary=$realtimePrimary, min60LinkH4=$min60LinkH4, h4LinkMin60=$h4LinkMin60, volumeLevel=$volumeLevel, prioritySetH4=$prioritySetH4, prioritySetH12=$prioritySetH12, prioritySetDay=$prioritySetDay, priorityNumH4=$priorityNumH4, priorityNumH12=$priorityNumH12, priorityNumDay=$priorityNumDay, alarmH1=$alarmH1, alarmH4=$alarmH4, alarmH12=$alarmH12, alarmDay=$alarmDay)"
    }


}